<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-3.3.1.min.js"></script>
</head>

<body>

    <p>什么是JavaScript</p>
    <p>JavaScript是一门功能强大的编程语言</p>
    <h1>一起来学习JavaScript程序设计</h1>
    <hr />
    <p>JavaScript的发展历史</p>
    <input type="button" value="删除所有p元素" onclick="delp()" />
    <script>
        function delp() {
            var all_p = $("p");
            for (var i = 0; i < all_p.length; i++) {
                var oo = all_p[i];
                oo.parentNode.removeChild(oo);
            }
        }
    </script>
</body>

</html>